﻿using System;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;

namespace Common.Location
{
    [DefaultClassOptions]
    public class Address : BaseObject
    {
        public Address(Session session)
            : base(session)
        {
        }
        public override void AfterConstruction()
        {
            base.AfterConstruction();
        }

        private string _street;
        private City _city;
        private Country _country;
        private CountryState _countryState;
        private bool _isActive;
        private string _fullAddress;


        public string Street
        {
            get
            {
                return _street;
            }
            set
            {
                SetPropertyValue ("Street", ref _street , value);
            }
        }

        public City City
        {
            get
            {
                return _city;
            }
            set
            {
                SetPropertyValue ("City", ref _city , value);
            }
        }
        public Country Country
        {
            get
            {
                return _country;
            }
            set
            {
                SetPropertyValue ("Country", ref _country , value);
            }
        }

        public CountryState CountryState
        {
            get
            {
                return _countryState;
            }
            set
            {
                SetPropertyValue ("CountryState", ref _countryState , value);
            }
        }


        [Size (SizeAttribute.Unlimited)]
        public string FullAddress
        {
            get
            {
                return _fullAddress;
            }
            set
            {
                SetPropertyValue("FullAdress", ref  _fullAddress, value);
            }
        }


        public bool IsActive
        {
            get
            {
                return _isActive;
            }
            set
            {
                SetPropertyValue ("IsActive", ref _isActive , value);
            }
        }
    }
}
